package com.qd.panda.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 发劵计划
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("panda_card_plan")
public class CardPlan extends Model<CardPlan> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "plan_id", type = IdType.ASSIGN_ID)
    private String planId;
    /**
     * 计划名称
     */
    @TableField("plan_name")
    private String planName;
    /**
     * 兑换的开始时间
     */
    @TableField("use_start_time")
    private LocalDate useStartTime;
    /**
     * 兑换的结束时间
     */
    @TableField("use_end_time")
    private LocalDate useEndTime;
    /**
     * 卷有效期
     */
    @TableField("volume_validity")
    private Integer volumeValidity;
    /**
     * 计划内容
     */
    @TableField("plan_content")
    private String planContent;
    /**
     * 码数量
     */
    @TableField("allocated_quantity")
    private Integer allocatedQuantity;
    /**
     * 添加时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;
    /**
     * 操作人
     */
    @TableField("operator")
    private String operator;
    /**
     * 机构ID
     */
    @TableField("org_id")
    private String orgId;
    /**
     * 第三方劵商
     */
    @TableField("third_party")
    private String thirdParty;
    /**
     * 是否无限数量
     */
    @TableField("infinite_quantity")
    private String infiniteQuantity;
    /**
     * 是否回赠
     */
    @TableField("rebate")
    private String rebate;

    public void freeData() {
        this.planId = null;
        this.planName = null;
        this.useStartTime = null;
        this.useEndTime = null;
        this.volumeValidity = null;
        this.planContent = null;
        this.allocatedQuantity = null;
        this.addTime = null;
        this.updateTime = null;
        this.operator = null;
        this.orgId = null;
        this.thirdParty = null;
        this.infiniteQuantity = null;
        this.rebate = null;
    }

}
